﻿#region DaCoTestItem
/*----------------------------------------------------------------
// 文件名：DaCoTestItem.cs
// 功能描述：表dbo.Co_Test_Item的数据访问层
//
// 
// 创建时间：2009-11-20 DtataAccess template . Ver 5.0.20090413
//
// 修改标识： 
// 修改描述： 
//----------------------------------------------------------------*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data;
using System.Globalization;
using System.Text;
using System.Data.Common;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;

using EQT.Model;


namespace EQT.Dal
{
    ///可以继承更上层接口,ICoTestItem ,数据访问层基类DaBase，
    ///DaBase中包含了DbException异常处理静态方法
    public partial class DaCoTestItem : DaBase<MoCoTestItem>
    {
        #region SQL const
        internal const string TABLE_COLUMNS = " CO_ITEM_ID ,REPORT_ID ,ITEM_CODE ,ITEM_TITLE ,TEST_PARAMETERS ,PRICE ,CHARGE_DEPT_CODE ,SAMPLE_REV_DATE ,CHARGE_MASTER ,TASK_ASSIGN_DATE ,TEST_BEGIN_DATE ,TEST_FINISH_DATE ,TEST_STATUS ,LAST_STATUS_TIME   ";

        internal const string SQL_INSERT = "INSERT INTO CO_TEST_ITEM (" + TABLE_COLUMNS + ") VALUES (@CoItemId,@ReportId,@ItemCode,@ItemTitle,@TestParameters,@Price,@ChargeDeptCode,@SampleRevDate,@ChargeMaster,@TaskAssignDate,@TestBeginDate,@TestFinishDate,@TestStatus,@LastStatusTime)";
        internal const string SQL_SELECT = "SELECT " + TABLE_COLUMNS + " FROM CO_TEST_ITEM  ";
        internal const string SQL_SELECT_ONE = SQL_SELECT + " WHERE CO_ITEM_ID=@CoItemId";

        internal const string SQL_EXIST = "SELECT COUNT(*) FROM CO_TEST_ITEM  WHERE CO_ITEM_ID=@CoItemId  ";
        internal const string SQL_UPDATE = "UPDATE CO_TEST_ITEM SET REPORT_ID=@ReportId, ITEM_CODE=@ItemCode, ITEM_TITLE=@ItemTitle, TEST_PARAMETERS=@TestParameters, PRICE=@Price, CHARGE_DEPT_CODE=@ChargeDeptCode, SAMPLE_REV_DATE=@SampleRevDate, CHARGE_MASTER=@ChargeMaster, TASK_ASSIGN_DATE=@TaskAssignDate, TEST_BEGIN_DATE=@TestBeginDate, TEST_FINISH_DATE=@TestFinishDate, TEST_STATUS=@TestStatus, LAST_STATUS_TIME=@LastStatusTime WHERE CO_ITEM_ID=@CoItemId";

        internal const string SQL_DELETE_DEFAULT = "DELETE FROM CO_TEST_ITEM ";
        internal const string SQL_DELETE = "DELETE FROM CO_TEST_ITEM WHERE CO_ITEM_ID=@CoItemId";

        internal const string SQL_COUNT = "SELECT COUNT(*) FROM Co_Test_Item ";
        #endregion

        #region Constructor

        /// <summary>
        /// 默认构造函数，使用配置文件中默认的数据库配置。
        /// </summary>
        public DaCoTestItem()
        {
            this.db = DatabaseFactory.CreateDatabase();
        }
        /// <summary>
        /// 使用指定的databaseName数据库配置。
        /// </summary>
        /// <param name="databaseName">配置文件中数据库的配置名称。</param>
        public DaCoTestItem(string databaseName)
        {
            this.db = DatabaseFactory.CreateDatabase(databaseName);
        }

        public DaCoTestItem(Database db)
        {
            this.db = db;
        }

        #endregion

        //以下是CRUD方法，每个方法都有引入外部事务的版本

        #region 构造器模块

        internal override MoCoTestItem ConstructT()
        {
            return new MoCoTestItem();
        }
        #endregion



        #region Add模块 Helper

        ///build the command object.It never throw exception.
        internal override DbCommand ConstructAddCommand(Database db)
        {
            DbCommand dbCommand = db.GetSqlStringCommand(SQL_INSERT);

            db.AddInParameter(dbCommand, "CoItemId", DbType.AnsiString);
            db.AddInParameter(dbCommand, "ReportId", DbType.AnsiString);
            db.AddInParameter(dbCommand, "ItemCode", DbType.AnsiString);
            db.AddInParameter(dbCommand, "ItemTitle", DbType.String);
            db.AddInParameter(dbCommand, "TestParameters", DbType.String);
            db.AddInParameter(dbCommand, "Price", DbType.Decimal);
            db.AddInParameter(dbCommand, "ChargeDeptCode", DbType.AnsiString);
            db.AddInParameter(dbCommand, "SampleRevDate", DbType.DateTime);
            db.AddInParameter(dbCommand, "ChargeMaster", DbType.AnsiString);
            db.AddInParameter(dbCommand, "TaskAssignDate", DbType.DateTime);
            db.AddInParameter(dbCommand, "TestBeginDate", DbType.DateTime);
            db.AddInParameter(dbCommand, "TestFinishDate", DbType.DateTime);
            db.AddInParameter(dbCommand, "TestStatus", DbType.Int32);
            db.AddInParameter(dbCommand, "LastStatusTime", DbType.DateTime);
            return dbCommand;
        }
        internal override DbCommand ConstructAddCommand(Database db, MoCoTestItem entity)
        {
            DbCommand dbCommand = db.GetSqlStringCommand(SQL_INSERT);
            db.AddInParameter(dbCommand, "CoItemId", DbType.AnsiString, entity.CoItemId);
            db.AddInParameter(dbCommand, "ReportId", DbType.AnsiString, entity.ReportId);
            db.AddInParameter(dbCommand, "ItemCode", DbType.AnsiString, entity.ItemCode);
            db.AddInParameter(dbCommand, "ItemTitle", DbType.String, entity.ItemTitle);
            db.AddInParameter(dbCommand, "TestParameters", DbType.String, entity.TestParameters);
            db.AddInParameter(dbCommand, "Price", DbType.Decimal, entity.Price);
            db.AddInParameter(dbCommand, "ChargeDeptCode", DbType.AnsiString, entity.ChargeDeptCode);
            db.AddInParameter(dbCommand, "SampleRevDate", DbType.DateTime, entity.SampleRevDate);
            db.AddInParameter(dbCommand, "ChargeMaster", DbType.AnsiString, entity.ChargeMaster);
            db.AddInParameter(dbCommand, "TaskAssignDate", DbType.DateTime, entity.TaskAssignDate);
            db.AddInParameter(dbCommand, "TestBeginDate", DbType.DateTime, entity.TestBeginDate);
            db.AddInParameter(dbCommand, "TestFinishDate", DbType.DateTime, entity.TestFinishDate);
            db.AddInParameter(dbCommand, "TestStatus", DbType.Int32, entity.TestStatus);
            db.AddInParameter(dbCommand, "LastStatusTime", DbType.DateTime, entity.LastStatusTime);
            return dbCommand;
        }

        internal override DbCommand PopulateAddCommandParameters(Database db, DbCommand addCmd, MoCoTestItem entity)
        {
            db.SetParameterValue(addCmd, "CoItemId", entity.CoItemId);
            db.SetParameterValue(addCmd, "ReportId", entity.ReportId);
            db.SetParameterValue(addCmd, "ItemCode", entity.ItemCode);
            db.SetParameterValue(addCmd, "ItemTitle", entity.ItemTitle);
            db.SetParameterValue(addCmd, "TestParameters", entity.TestParameters);
            db.SetParameterValue(addCmd, "Price", entity.Price);
            db.SetParameterValue(addCmd, "ChargeDeptCode", entity.ChargeDeptCode);
            db.SetParameterValue(addCmd, "SampleRevDate", entity.SampleRevDate);
            db.SetParameterValue(addCmd, "ChargeMaster", entity.ChargeMaster);
            db.SetParameterValue(addCmd, "TaskAssignDate", entity.TaskAssignDate);
            db.SetParameterValue(addCmd, "TestBeginDate", entity.TestBeginDate);
            db.SetParameterValue(addCmd, "TestFinishDate", entity.TestFinishDate);
            db.SetParameterValue(addCmd, "TestStatus", entity.TestStatus);
            db.SetParameterValue(addCmd, "LastStatusTime", entity.LastStatusTime);
            return addCmd;
        }

        internal override DbCommand PopulateAddCommandParameters(Database db, DbCommand addCmd, DataRow row)
        {
            db.SetParameterValue(addCmd, "CoItemId", row["CoItemId"]);
            db.SetParameterValue(addCmd, "ReportId", row["ReportId"]);
            db.SetParameterValue(addCmd, "ItemCode", row["ItemCode"]);
            db.SetParameterValue(addCmd, "ItemTitle", row["ItemTitle"]);
            db.SetParameterValue(addCmd, "TestParameters", row["TestParameters"]);
            db.SetParameterValue(addCmd, "Price", row["Price"]);
            db.SetParameterValue(addCmd, "ChargeDeptCode", row["ChargeDeptCode"]);
            db.SetParameterValue(addCmd, "SampleRevDate", row["SampleRevDate"]);
            db.SetParameterValue(addCmd, "ChargeMaster", row["ChargeMaster"]);
            db.SetParameterValue(addCmd, "TaskAssignDate", row["TaskAssignDate"]);
            db.SetParameterValue(addCmd, "TestBeginDate", row["TestBeginDate"]);
            db.SetParameterValue(addCmd, "TestFinishDate", row["TestFinishDate"]);
            db.SetParameterValue(addCmd, "TestStatus", row["TestStatus"]);
            db.SetParameterValue(addCmd, "LastStatusTime", row["LastStatusTime"]);
            return addCmd;
        }

        #endregion

        #region Update模块 Helper

        internal override DbCommand ConstructUpdateCommand(Database db)
        {
            DbCommand dbCommand = db.GetSqlStringCommand(SQL_UPDATE);
            db.AddInParameter(dbCommand, "ReportId", DbType.AnsiString);
            db.AddInParameter(dbCommand, "ItemCode", DbType.AnsiString);
            db.AddInParameter(dbCommand, "ItemTitle", DbType.String);
            db.AddInParameter(dbCommand, "TestParameters", DbType.String);
            db.AddInParameter(dbCommand, "Price", DbType.Decimal);
            db.AddInParameter(dbCommand, "ChargeDeptCode", DbType.AnsiString);
            db.AddInParameter(dbCommand, "SampleRevDate", DbType.DateTime);
            db.AddInParameter(dbCommand, "ChargeMaster", DbType.AnsiString);
            db.AddInParameter(dbCommand, "TaskAssignDate", DbType.DateTime);
            db.AddInParameter(dbCommand, "TestBeginDate", DbType.DateTime);
            db.AddInParameter(dbCommand, "TestFinishDate", DbType.DateTime);
            db.AddInParameter(dbCommand, "TestStatus", DbType.Int32);
            db.AddInParameter(dbCommand, "LastStatusTime", DbType.DateTime);
            db.AddInParameter(dbCommand, "CoItemId", DbType.AnsiString);

            return dbCommand;
        }
        internal override DbCommand ConstructUpdateCommand(Database db, MoCoTestItem entity)
        {
            DbCommand dbCommand = db.GetSqlStringCommand(SQL_UPDATE);
            db.AddInParameter(dbCommand, "ReportId", DbType.AnsiString, entity.ReportId);
            db.AddInParameter(dbCommand, "ItemCode", DbType.AnsiString, entity.ItemCode);
            db.AddInParameter(dbCommand, "ItemTitle", DbType.String, entity.ItemTitle);
            db.AddInParameter(dbCommand, "TestParameters", DbType.String, entity.TestParameters);
            db.AddInParameter(dbCommand, "Price", DbType.Decimal, entity.Price);
            db.AddInParameter(dbCommand, "ChargeDeptCode", DbType.AnsiString, entity.ChargeDeptCode);
            db.AddInParameter(dbCommand, "SampleRevDate", DbType.DateTime, entity.SampleRevDate);
            db.AddInParameter(dbCommand, "ChargeMaster", DbType.AnsiString, entity.ChargeMaster);
            db.AddInParameter(dbCommand, "TaskAssignDate", DbType.DateTime, entity.TaskAssignDate);
            db.AddInParameter(dbCommand, "TestBeginDate", DbType.DateTime, entity.TestBeginDate);
            db.AddInParameter(dbCommand, "TestFinishDate", DbType.DateTime, entity.TestFinishDate);
            db.AddInParameter(dbCommand, "TestStatus", DbType.Int32, entity.TestStatus);
            db.AddInParameter(dbCommand, "LastStatusTime", DbType.DateTime, entity.LastStatusTime);
            db.AddInParameter(dbCommand, "CoItemId", DbType.AnsiString, entity.CoItemId);

            return dbCommand;
        }

        internal override DbCommand PopulateUpdateCommandParameters(Database db, DbCommand updateCmd, MoCoTestItem entity)
        {
            db.SetParameterValue(updateCmd, "ReportId", entity.ReportId);
            db.SetParameterValue(updateCmd, "ItemCode", entity.ItemCode);
            db.SetParameterValue(updateCmd, "ItemTitle", entity.ItemTitle);
            db.SetParameterValue(updateCmd, "TestParameters", entity.TestParameters);
            db.SetParameterValue(updateCmd, "Price", entity.Price);
            db.SetParameterValue(updateCmd, "ChargeDeptCode", entity.ChargeDeptCode);
            db.SetParameterValue(updateCmd, "SampleRevDate", entity.SampleRevDate);
            db.SetParameterValue(updateCmd, "ChargeMaster", entity.ChargeMaster);
            db.SetParameterValue(updateCmd, "TaskAssignDate", entity.TaskAssignDate);
            db.SetParameterValue(updateCmd, "TestBeginDate", entity.TestBeginDate);
            db.SetParameterValue(updateCmd, "TestFinishDate", entity.TestFinishDate);
            db.SetParameterValue(updateCmd, "TestStatus", entity.TestStatus);
            db.SetParameterValue(updateCmd, "LastStatusTime", entity.LastStatusTime);
            db.SetParameterValue(updateCmd, "CoItemId", entity.CoItemId);
            return updateCmd;
        }
        internal override DbCommand PopulateUpdateCommandParameters(Database db, DbCommand updateCmd, DataRow row)
        {
            db.SetParameterValue(updateCmd, "ReportId", row["ReportId"]);
            db.SetParameterValue(updateCmd, "ItemCode", row["ItemCode"]);
            db.SetParameterValue(updateCmd, "ItemTitle", row["ItemTitle"]);
            db.SetParameterValue(updateCmd, "TestParameters", row["TestParameters"]);
            db.SetParameterValue(updateCmd, "Price", row["Price"]);
            db.SetParameterValue(updateCmd, "ChargeDeptCode", row["ChargeDeptCode"]);
            db.SetParameterValue(updateCmd, "SampleRevDate", row["SampleRevDate"]);
            db.SetParameterValue(updateCmd, "ChargeMaster", row["ChargeMaster"]);
            db.SetParameterValue(updateCmd, "TaskAssignDate", row["TaskAssignDate"]);
            db.SetParameterValue(updateCmd, "TestBeginDate", row["TestBeginDate"]);
            db.SetParameterValue(updateCmd, "TestFinishDate", row["TestFinishDate"]);
            db.SetParameterValue(updateCmd, "TestStatus", row["TestStatus"]);
            db.SetParameterValue(updateCmd, "LastStatusTime", row["LastStatusTime"]);
            db.SetParameterValue(updateCmd, "CoItemId", row["CoItemId"]);
            return updateCmd;
        }

        internal override void PrepareDataAdapterCommand(Database db, out DbCommand dbInsertCommand,
                             out DbCommand dbUpdateCommand, out DbCommand dbDeleteCommand)
        {
            dbInsertCommand = db.GetSqlStringCommand(SQL_INSERT);
            #region set insert cmd parameters
            db.AddInParameter(dbInsertCommand, "CoItemId", DbType.AnsiString, "CO_ITEM_ID", DataRowVersion.Current);
            db.AddInParameter(dbInsertCommand, "ReportId", DbType.AnsiString, "REPORT_ID", DataRowVersion.Current);
            db.AddInParameter(dbInsertCommand, "ItemCode", DbType.AnsiString, "ITEM_CODE", DataRowVersion.Current);
            db.AddInParameter(dbInsertCommand, "ItemTitle", DbType.String, "ITEM_TITLE", DataRowVersion.Current);
            db.AddInParameter(dbInsertCommand, "TestParameters", DbType.String, "TEST_PARAMETERS", DataRowVersion.Current);
            db.AddInParameter(dbInsertCommand, "Price", DbType.Decimal, "PRICE", DataRowVersion.Current);
            db.AddInParameter(dbInsertCommand, "ChargeDeptCode", DbType.AnsiString, "CHARGE_DEPT_CODE", DataRowVersion.Current);
            db.AddInParameter(dbInsertCommand, "SampleRevDate", DbType.DateTime, "SAMPLE_REV_DATE", DataRowVersion.Current);
            db.AddInParameter(dbInsertCommand, "ChargeMaster", DbType.AnsiString, "CHARGE_MASTER", DataRowVersion.Current);
            db.AddInParameter(dbInsertCommand, "TaskAssignDate", DbType.DateTime, "TASK_ASSIGN_DATE", DataRowVersion.Current);
            db.AddInParameter(dbInsertCommand, "TestBeginDate", DbType.DateTime, "TEST_BEGIN_DATE", DataRowVersion.Current);
            db.AddInParameter(dbInsertCommand, "TestFinishDate", DbType.DateTime, "TEST_FINISH_DATE", DataRowVersion.Current);
            db.AddInParameter(dbInsertCommand, "TestStatus", DbType.Int32, "TEST_STATUS", DataRowVersion.Current);
            db.AddInParameter(dbInsertCommand, "LastStatusTime", DbType.DateTime, "LAST_STATUS_TIME", DataRowVersion.Current);
            #endregion
            dbUpdateCommand = db.GetSqlStringCommand(SQL_UPDATE);
            #region Set update cmd value parameters
            db.AddInParameter(dbUpdateCommand, "ReportId", DbType.AnsiString, "REPORT_ID", DataRowVersion.Current);
            db.AddInParameter(dbUpdateCommand, "ItemCode", DbType.AnsiString, "ITEM_CODE", DataRowVersion.Current);
            db.AddInParameter(dbUpdateCommand, "ItemTitle", DbType.String, "ITEM_TITLE", DataRowVersion.Current);
            db.AddInParameter(dbUpdateCommand, "TestParameters", DbType.String, "TEST_PARAMETERS", DataRowVersion.Current);
            db.AddInParameter(dbUpdateCommand, "Price", DbType.Decimal, "PRICE", DataRowVersion.Current);
            db.AddInParameter(dbUpdateCommand, "ChargeDeptCode", DbType.AnsiString, "CHARGE_DEPT_CODE", DataRowVersion.Current);
            db.AddInParameter(dbUpdateCommand, "SampleRevDate", DbType.DateTime, "SAMPLE_REV_DATE", DataRowVersion.Current);
            db.AddInParameter(dbUpdateCommand, "ChargeMaster", DbType.AnsiString, "CHARGE_MASTER", DataRowVersion.Current);
            db.AddInParameter(dbUpdateCommand, "TaskAssignDate", DbType.DateTime, "TASK_ASSIGN_DATE", DataRowVersion.Current);
            db.AddInParameter(dbUpdateCommand, "TestBeginDate", DbType.DateTime, "TEST_BEGIN_DATE", DataRowVersion.Current);
            db.AddInParameter(dbUpdateCommand, "TestFinishDate", DbType.DateTime, "TEST_FINISH_DATE", DataRowVersion.Current);
            db.AddInParameter(dbUpdateCommand, "TestStatus", DbType.Int32, "TEST_STATUS", DataRowVersion.Current);
            db.AddInParameter(dbUpdateCommand, "LastStatusTime", DbType.DateTime, "LAST_STATUS_TIME", DataRowVersion.Current);
            #endregion
            #region set update cmd pk where parameters
            db.AddInParameter(dbUpdateCommand, "CoItemId", DbType.AnsiString, "CO_ITEM_ID", DataRowVersion.Current);
            #endregion
            dbDeleteCommand = db.GetSqlStringCommand(SQL_DELETE);
            #region set delete cmd pk where parameters
            db.AddInParameter(dbDeleteCommand, "CoItemId", DbType.AnsiString, "CO_ITEM_ID", DataRowVersion.Current);
            #endregion
        }
        #endregion

        #region Delete模块 Helper

        internal override DbCommand ConstructDeleteCommand(Database db)
        {
            DbCommand dbCommand = db.GetSqlStringCommand(SQL_DELETE);

            db.AddInParameter(dbCommand, "CoItemId", DbType.AnsiString);

            return dbCommand;
        }
        internal override DbCommand ConstructDeleteCommand(Database db, MoCoTestItem entity)
        {
            DbCommand dbCommand = db.GetSqlStringCommand(SQL_DELETE);

            db.AddInParameter(dbCommand, "CoItemId", DbType.AnsiString, entity.CoItemId);

            return dbCommand;
        }

        internal override DbCommand ConstructDeleteCommandForWhere(Database db, string where)
        {
            return db.GetSqlStringCommand(SQL_DELETE_DEFAULT + where);
        }

        internal override DbCommand PopulateDeleteCommandParameters(Database db, DbCommand deleteCmd, MoCoTestItem entity)
        {
            db.SetParameterValue(deleteCmd, "CoItemId", entity.CoItemId);
            return deleteCmd;
        }

        internal override DbCommand PopulateDeleteCommandParameters(Database db, DbCommand deleteCmd, DataRow row)
        {
            db.SetParameterValue(deleteCmd, "CoItemId", row["CoItemId"]);
            return deleteCmd;
        }

        #endregion helper

        #region Query模块 Helper

        internal override DbCommand ConstructQueryCommand(string condition)
        {
            return db.GetSqlStringCommand(SQL_SELECT + condition);
        }

        #endregion

        #region GetEntity(s)模块 Helper

        internal override DbCommand ConstructSelectOneCommand(Database db, MoCoTestItem entity)
        {
            DbCommand dbCommand = db.GetSqlStringCommand(SQL_SELECT_ONE);

            db.AddInParameter(dbCommand, "CoItemId", DbType.AnsiString, entity.CoItemId);
            return dbCommand;
        }

        internal override void PopulateEntityByDataReader(IDataReader reader, ref MoCoTestItem entity)
        {
            if (!reader.IsDBNull(0)) entity.CoItemId = reader.GetString(0);
            if (!reader.IsDBNull(1)) entity.ReportId = reader.GetString(1);
            if (!reader.IsDBNull(2)) entity.ItemCode = reader.GetString(2);
            if (!reader.IsDBNull(3)) entity.ItemTitle = reader.GetString(3);
            if (!reader.IsDBNull(4)) entity.TestParameters = reader.GetString(4);
            if (!reader.IsDBNull(5)) entity.Price = reader.GetDecimal(5);
            if (!reader.IsDBNull(6)) entity.ChargeDeptCode = reader.GetString(6);
            if (!reader.IsDBNull(7)) entity.SampleRevDate = reader.GetDateTime(7);
            if (!reader.IsDBNull(8)) entity.ChargeMaster = reader.GetString(8);
            if (!reader.IsDBNull(9)) entity.TaskAssignDate = reader.GetDateTime(9);
            if (!reader.IsDBNull(10)) entity.TestBeginDate = reader.GetDateTime(10);
            if (!reader.IsDBNull(11)) entity.TestFinishDate = reader.GetDateTime(11);
            if (!reader.IsDBNull(12)) entity.TestStatus = reader.GetInt32(12);
            if (!reader.IsDBNull(13)) entity.LastStatusTime = reader.GetDateTime(13);
        }



        internal override DbCommand ConstructSelectConditionCommand(Database db, string condition)
        {
            return db.GetSqlStringCommand(SQL_SELECT + condition);
        }

        #endregion

        #region Count模块 Helper

        internal override DbCommand ConstructCountCommand(Database db)
        {
            return db.GetSqlStringCommand(SQL_COUNT);
        }

        internal override DbCommand ConstructCountConditionCommand(Database db, string condition)
        {
            return db.GetSqlStringCommand(SQL_COUNT + condition);
        }

        #endregion

        #region IsExist模块 Helper

        internal override DbCommand ConstructIsExistCommand(Database db, MoCoTestItem entity)
        {
            DbCommand dbCommand = db.GetSqlStringCommand(SQL_EXIST);
            db.AddInParameter(dbCommand, "CoItemId", DbType.AnsiString, entity.CoItemId);
            return dbCommand;
        }

        #endregion



    }
}
#endregion

